(define midi-trans-ch (lambda (ch) ch))

(midi-trans-ch 1 0 0)

;Put that in your Song to adapt your midi input
(define-macro (midi-transform . body)
   `((let 
        ((x (lambda (ch note vol) 0)))
        (set! midi-trans-ch (sys:compile x)))))


(define-macro (midi:toggle:bypass id _instr start)
   `(toggle ,id ,start (lambda (state)
       (au:midi-out (now) (instr:node-id ,_instr) 11 0 123 0)
       (instr:set ,_instr "bypass-midi" state)
       (instr:update-midi)                 
   )))

(define-macro (midi:toggle:note id _instr ch note  vol)
   `(toggle ,id #f (lambda (state)
        (au:midi-out (now) (instr:node-id ,_instr) (if state *io:midi-on* *io:midi-off*) ,ch ,note ,vol)
   )))
